<?php

require "vendor/autoload.php";

use User\UserClient;

$credentials = \Grpc\ChannelCredentials::createInsecure();
$client = new UserClient("127.0.0.1:8200", ['credentials' => $credentials]);

$request = new \User\IdReq();
$request->setId(1); // 设置请求userId

$result = $client->getUser($request)->wait();

list($reply, $status) = $result;

$name = $reply->getName();

echo $name . PHP_EOL; // 小明

exit();
